package com.lhc.controller;

import com.lhc.domain.response.CommonResponse;
import com.lhc.domain.response.ResponseEnum;
import com.lhc.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController(value = "test")
public class TestController {

    @Autowired
    @Qualifier(value = "testServiceImpl")
    private TestService testService;

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public CommonResponse<String> test() {
        System.out.println("test");
        testService.test("name");

        CommonResponse<String> response = new CommonResponse<>();
        response.setCode(ResponseEnum.SUCCESS.getCode());
        response.setMessage(ResponseEnum.SUCCESS.getMessage());
        response.setResponseData("aaa");
        return response;
    }
}
